<!DOCTYPE html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="support/helper.sub.js"></script>
</head>
<body>
<script>
  var testnb = 0;

  // TrustedScriptURL Assignments
  const scriptURLTestCases = [
    [ 'embed', 'src' ],
    [ 'script', 'src' ]
  ];

  testnb = 0;
  scriptURLTestCases.forEach(c => {
    test(t => {
      assert_element_accepts_trusted_script_url(window, ++testnb, t, c[0], c[1], RESULTS.SCRIPTURL);
    }, c[0] + "." + c[1] + " assigned via policy (successful ScriptURL transformation)");
  });

  // TrustedHTML Assignments
  const HTMLTestCases = [
    [ 'div', 'innerHTML' ],
    [ 'iframe', 'srcdoc' ]
  ];

  testnb = 0;
  HTMLTestCases.forEach(c => {
    test(t => {
      assert_element_accepts_trusted_html(window, ++testnb, t, c[0], c[1], RESULTS.HTML);
    }, c[0] + "." + c[1] + " assigned via policy (successful HTML transformation)");
  });

  // TrustedScript Assignments
  const scriptTestCases = [
    [ 'script', 'text' ],
    [ 'script', 'innerText' ],
    [ 'script', 'textContent' ]
  ];

  testnb = 0;
  scriptTestCases.forEach(c => {
    test(t => {
      assert_element_accepts_trusted_script(window, c, t, c[0], c[1], RESULTS.SCRIPT);
    }, c[0] + "." + c[1] + " assigned via policy (successful Script transformation)");
  });
</script>
